import java.util.*;

public class Main {
    public static void main(String[] args) {
        ArrayList<Student> alst = new ArrayList();
        alst.add(new Student(1001, "Zhangmeng", 20));
        alst.add(new Student(1002, "Lizhaoyi", 21));
        alst.add(new Student(1003, "Wangshi", 19));
        int index = 0;
        for (int i = 0; i < alst.size(); i++) {
            if (alst.get(i).getSid() == 1003) {
                index = i;
                break;
            }
        }
        alst.add(index, new Student(2006, "Zhaomei", 20));
        alst.remove(index + 1);
        alst.forEach(System.out::println);
        for (Student s : alst) {
            System.out.println(s);
        }
    }
}

class Student {
    private int sid;
    private String name;
    private int age;

    public Student(int sid, String name, int age) {
        this.sid = sid;
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "sid=" + sid +
                ", name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public int getSid() {
        return sid;
    }

    public void setSid(int sid) {
        this.sid = sid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}